#ifndef _BBPLATFORM_H_
#define _BBPLATFORM_H_


#define BB_RENDEENQINE_UNKNOWN				0
#define BB_RENDEENQINE_COCOS2DX				1
#define BB_RENDEENQINE_IRRLICHT					2

#define BB_TARGET_RENDEENQINE             BB_RENDEENQINE_COCOS2DX



#define BB_CREATE_PROPERTY(varType,varName,funName)\
protected:varType varName;\
public: virtual varType get##funName(void);\
public: virtual void set##funName(varType var);


#define BB_CREATE_PROPERTY_BY_BOOL(varName,funName)\
protected:bool varName;\
public: virtual bool is##funName(void);\
public: virtual void set##funName(bool var);

#define BB_CREATE_PROPERTY_BY_REF(varType, varName, funName)\
protected: varType varName;\
public: virtual const varType& get##funName(void);\
public: virtual void set##funName(const varType& var);

#define BB_CREATE_PROPERTY_READONLY(varType, varName, funName)\
protected: varType varName;\
public: virtual varType get##funName(void) const { return varName; }

#define BB_CREATE_PROPERTY_READONLY_BY_REF(varType, varName, funName)\
protected: varType varName;\
public: virtual const varType& get##funName(void) const { return varName; }


#define BB_SAFE_DELETE(p)							do{if(p){delete p;p = 0;}}while(0)
#define BB_SAFE_DELETE_ARRAY(p)				do{if(p){delete[] p;p = 0;}}while(0)
#define BB_BREAK_IF(cond)							 if(cond) break

#if (BB_TARGET_RENDEENQINE == BB_RENDEENQINE_COCOS2DX)
	#define BBLog(condition,msg)		CCAssert(condition,msg)
#endif






#endif

